<template>
	<view class="discover">
		<view class="uni-list">
			<view class="uni-list-cell" v-for="(value,key) in listData" :key="key" @click="goDetail(value)">
				<view class="uni-media-list-text-top">{{value.title}}</view>
				<view class="uni-media-list-text-bottom">
					<image class="uni-media-list-logo" :src="value.cover"></image>
					<text class="uni-media-list-text">{{value.author_name}}</text>
					<text style="padding-left: 20px;" class="uni-media-list-text">{{value.published_at}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				listData: [{
						"title": 'aaa',
						"cover": 'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2716688360,1326705556&fm=27&gp=0.jpg',
						"author_name": "bbbb",
						"published_at": "ccc"
					},
					{
						"title": 'aaa',
						"cover": 'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2716688360,1326705556&fm=27&gp=0.jpg',
						"author_name": "bbbb",
						"published_at": "ccc"
					},
					{
						"title": 'aaa',
						"cover": 'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2716688360,1326705556&fm=27&gp=0.jpg',
						"author_name": "bbbb",
						"published_at": "ccc"
					},
					{
						"title": 'aaa',
						"cover": 'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2716688360,1326705556&fm=27&gp=0.jpg',
						"author_name": "bbbb",
						"published_at": "ccc"
					}
				]
			}

		},
		methods: {
			goDetail(value) {
				console.log(value)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.discover {
		background: #F4F4F4;
		height: 100vh;

		.uni-list {
			display: flex;
			flex-direction: column;

			.uni-list-cell {
				background: #FFFFFF;
				margin: 10px 10px;
				padding: 5px 10px 5px 10px;
				border-radius: 5px;
				height: 45px;
				overflow: hidden;

				.uni-media-list-text-top {
					width: 100%;
					font-size: 20px;
				}

				.uni-media-list-text-bottom {
					display: flex;
					width: 100%;
					height: 20px;
					color: #8f8f94;

					.uni-media-list-logo {
						width: 20px;
						height: 20px;
						border-radius: 50%;
					}
				}
			}
		}
	}
</style>
